/*
Sum square difference
Problem 6
Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 - 385 = 2640.

Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.

*/

var linq = require('linq');
var start = new Date().getTime();

var squareOfSum = 0;
var sumOfSqaures = 0;

for (var i = 1; i <= 100; i++) {
    sumOfSqaures += i * i;
}

for (var i = 1; i <= 100; i++) {
    squareOfSum += i;
}

squareOfSum = squareOfSum * squareOfSum;

console.log(squareOfSum - sumOfSqaures);

var end = new Date().getTime();
var time = end - start;

console.log("Time: ", time);

require('readline')
    .createInterface(process.stdin, process.stdout)
    .question("Press [Enter] to exit...", function(){
        process.exit();
});